﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Hotel.WPF
{
    /// <summary>
    /// Interaction logic for W_Hotel.xaml
    /// </summary>
    public partial class W_Hotel : Window
    {
        public static Page pageEncours;
        public static Frame framePage;
        public W_Hotel()
        {
            InitializeComponent();
            frame1.Width = SystemParameters.WorkArea.Width;
            frame1.Height = SystemParameters.WorkArea.Height - 25;
            framePage = frame1;
            svPrincipal.Width = SystemParameters.WorkArea.Width;
            svPrincipal.Height = SystemParameters.WorkArea.Height - ribbonH.Height;
            //pageEncours = new ui.P_Default();
            setPageAccueil();
        }

        private void mi_param_Click(object sender, RoutedEventArgs e)
        {
            Page win = new Hotel.WPF.ui.ChaineHotel.P_ChaineHotel();
            frame1.Navigate(win);
        }

        private void mnQuitter_Click(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }

        private void mnSecurite_Click(object sender, RoutedEventArgs e)
        {

        }

        private void mnSearch_Click(object sender, RoutedEventArgs e)
        {

        }

        private void mnPlanning_Click(object sender, RoutedEventArgs e)
        {

        }

        private void mnCarnet_Click(object sender, RoutedEventArgs e)
        {

        }

        private void mnImprimer_Click(object sender, RoutedEventArgs e)
        {
            pageEncours = new ui.P_Default();
            ((ui.P_Default)pageEncours).lb_titre.Content = "Imprimer";
            frame1.Navigate(pageEncours);
            //MessageBox.Show("imprimer");
        }

 
        private void mnChaine_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                pageEncours = new ui.ChaineHotel.P_ChaineHotel();
                frame1.Navigate(pageEncours);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            
        }

        private void mnHotel_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                pageEncours = new ui.Hotelss.P_Hotel();
                frame1.Navigate(pageEncours);
                
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void mnChambre_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                pageEncours = new ui.Chambre.P_Chambre();
                frame1.Navigate(pageEncours);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void mnClient_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                pageEncours = new ui.Client.P_Client();
                frame1.Navigate(pageEncours);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void mnGuest_Click(object sender, RoutedEventArgs e)
        {
            pageEncours = new ui.P_Default();
            ((ui.P_Default)pageEncours).lb_titre.Content = "Guest";
            frame1.Navigate(pageEncours);
        }

        private void mnReservation_Click(object sender, RoutedEventArgs e)
        {
            pageEncours = new ui.P_Default();
            ((ui.P_Default)pageEncours).lb_titre.Content = "Reservation";
            frame1.Navigate(pageEncours);
        }

        private void mnFacture_Click(object sender, RoutedEventArgs e)
        {
            pageEncours = new ui.P_Default();
            ((ui.P_Default)pageEncours).lb_titre.Content = "Facturation";
            frame1.Navigate(pageEncours);
        }

        private void mnCaractHotel_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                pageEncours = new ui.CaracteristikHotel.P_RefCaracteristiqueHotel();
                frame1.Navigate(pageEncours);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void frame1_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
        {
            //on vide l'historique de navigation
            frame1.NavigationService.RemoveBackEntry();
        }

        private void mnAccueil_Click(object sender, RoutedEventArgs e)
        {
            setPageAccueil();
        }

        private void setPageAccueil()
        {
            try
            {
                pageEncours = new ui.P_Default();
                ((ui.P_Default)pageEncours).lb_titre.Content = "";
                frame1.Navigate(pageEncours);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

        private void mnClientEnreg_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                pageEncours = new ui.Client.P_Client();
               // ((ui.P_Default)pageEncours).lb_titre.Content = "";
                frame1.Navigate(pageEncours);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }


    }
}
